package cn.edu.scut.sys.vo;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * TrainScoreItem entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "train_score_item", catalog = "scoredb")
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})
public class TrainScoreItem implements java.io.Serializable {

	private static final long serialVersionUID = -7892202977683237114L;
	
	// Fields
	
	private Long id;
	private TrainItem trainItem;
	private TrainScore trainScore;
	private Integer score;

	// Constructors

	/** default constructor */
	public TrainScoreItem() {
	}

	/** full constructor */
	public TrainScoreItem(TrainItem trainItem, TrainScore trainScore,
			Integer score) {
		this.trainItem = trainItem;
		this.trainScore = trainScore;
		this.score = score;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "trainItemId")
	public TrainItem getTrainItem() {
		return this.trainItem;
	}

	public void setTrainItem(TrainItem trainItem) {
		this.trainItem = trainItem;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "trainScoreId")
	public TrainScore getTrainScore() {
		return this.trainScore;
	}

	public void setTrainScore(TrainScore trainScore) {
		this.trainScore = trainScore;
	}

	@Column(name = "score")
	public Integer getScore() {
		return this.score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

}